package com.lb.string;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @Author: zhangjun
 * @Date: 2020/5/23 10:10
 * @Description:
 */
public class StringTest {
    public static void main(String[] args) throws JsonProcessingException {
        String name = "张三";
        System.out.println(name.contains(" "));
        System.out.println(2 % 3 == 0);
        ObjectMapper objectMapper = new ObjectMapper();
        String[] str = {"123","456"};
        System.out.println(objectMapper.writeValueAsString(str));

        String a = "1个2串1＋1个3串1";
        String[] b = a.split("\\＋");
        System.out.println(b);

        String s = null;
        if ("123".equals(s)){
            System.out.println("ok");
        }

        String s1 = "abc";
        String s2 = "abc";
        System.out.println(s1 == s2);
        System.out.println("---------");

        String s3 = new String("abc");
        String s5 = new String("abc");
        String s4 = s3.intern();
        String s6 = s5.intern();

        System.out.println(s1 == s4);
        System.out.println(s4 == s6);

    }
}
